package game;

public class Marine implements Character{

	private int hp;
	private int speed;
	private int str;
	private String name;
	
	public Marine(String name){
		hp = 100;
		speed = 100;
		str = 1;
		this.name = name;
	}
	
	public int getHp(){
		return hp;
	}
	
	public int getSpeed(){
		return speed;
	}
	
	public int getStrength() {
		return str;
	}
	
	public void takeDammage(int dammage) throws DeathException{
		hp -= dammage;
		System.out.println("Le Marine prend " + dammage + " points de dégats");
		System.out.println("Il lui reste " + hp + " points de vie");
		if (hp <= 0){
			throw (new DeathException(this, null));
		}
	}
	
	public void attaque(Character c) throws DeathException{
		try{
		c.takeDammage(str);
		}catch (DeathException e){
			e.setKiller(this);
			throw (e);
		}
		System.out.println("le Marine attaque avec une force de " + str);
	}

	public String getName() {
		return name;
	}
	
}
